﻿namespace PersonMgrApp.Interfaces
{
    /// <summary>
    /// Interface for the Person Manager Class which is responsible for caching
    /// peoples name/age pairs, providing queryability, and refreshing the cache
    /// as needed. 
    /// </summary>
    public interface IPersonMgr
    {
        /// <summary>
        /// Gets a persons age. Updates cache if required
        /// </summary>
        /// <param name="name">person name to lookup</param>
        /// <returns>Persons age if found. Otherwise -1</returns>
        int GetPersonAge(string name);

        /// <summary>
        /// Refreshes the name/age cache if the internal timeout has elapsed
        /// </summary>
        void CheckRefresh();

        /// <summary>
        /// Forces an update of the name/age cache
        /// </summary>
        void Refresh();
    }
}
